/*
 * ResipUtil.h
 *
 *  Created on: 2015年6月4日
 *      Author: chuanjiang.zh@qq.com
 */

#ifndef RESIPUTIL_H_
#define RESIPUTIL_H_

#include "BasicType.h"
#include "Resip.h"
#include "resip/stack/SdpContents.hxx"

class ResipUtil
{
public:
    ResipUtil();
    virtual ~ResipUtil();

    static std::string toString(const SdpContents& sdp);
    static bool isDuplex(const SdpContents& sdp);
    static bool getVideoAddr(const SdpContents& sdp, Data& ip, uint16_t& port, uint8_t& payload);

    static std::string getStreamDir(const SdpContents::Session::Medium& medium);

    static std::string findAttr(const SdpContents::Session::Medium& medium, const char* key);

    static std::string findAttr(const SdpContents::Session& session, const char* key);

    static Mime makeMime(const std::string& mime);

    static void setMime(SipMessage& msg, const std::string& mime);

    static std::string getMime(const SipMessage& msg);

};

#endif /* RESIPUTIL_H_ */
